<!DOCTYPE html>
<html>
<head>
  <title>Pragprog Books Online Store</title>
  <%= stylesheet_link_tag    "application", media: "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body class="<%= controller.controller_name %>">
  <div id="banner">
    <%= image_tag("logo.png") %>
    <%= @page_title || "Pragmatic Bookshelf" %>
  </div>
  <div id="columns">
    <div id="side">
      <% if @cart %>
		<%= hidden_div_if(@cart.line_items.empty?, id: 'cart') do %>
	  		<%= render @cart %>
		<% end %>
	  <% end %>
      <ul>
        <li><a href="http://localhost:3000">Home</a></li>
        <li><a href="http://www..../faq">Questions</a></li>
        <li><a href="http://www..../news">News</a></li>
        <li><a href="http://www..../contact">Contact</a></li>
      </ul>    
      <% if session[:user_id] %>
        <ul>
          <li><%= link_to 'Orders', orders_path %></li>
          <li><%= link_to 'Products', products_path %></li>
          <li><%= link_to 'Users', users_path %></li>
        </ul>
        <%= button_to 'Logout', logout_path, method: :delete %>
      <% end %>
    </div>
    <div id="main">
      <%= yield %>
    </div>
  </div>
</body>
</html>
